{extend name="public/base"}

{block name="style"}
<link rel="stylesheet" href="__STATIC__/admin/css/news.css" media="all" />
{/block}


{block name="main"}
<body class="childrenBody">
<blockquote class="layui-elem-quote news_search">
    <form class="layui-form">
        <div class="layui-inline">
            <a class="layui-btn layui-btn-normal Add_btn" data-url="{:url('product_save')}" data-title="添加产品">添加产品</a>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select name="browseLook" class="newsLook" lay-filter="browseLook">
                    <option value="">产品分类</option>
                    <option value="0">白酒</option>
                    <option value="1">红酒</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-form-pane" style="margin-top: 15px;">
                <div class="layui-form-item">
                    <label class="layui-form-label">添加时间</label>
                    <div class="layui-input-inline">
                        <input class="layui-input" placeholder="开始日" id="LAY_demorange_s">
                    </div>
                    <div class="layui-input-inline">
                        <input class="layui-input" placeholder="截止日" id="LAY_demorange_e">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select name="browseLook" class="newsLook" lay-filter="browseLook">
                    <option value="">产品上架状态</option>
                    <option value="0">已上架</option>
                    <option value="1">已下架</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select name="browseLook" class="newsLook" lay-filter="browseLook">
                    <option value="">产品删除状态</option>
                    <option value="0">正常</option>
                    <option value="1">已删除</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <select name="browseLook" class="newsLook" lay-filter="browseLook">
                    <option value="">产品标签</option>
                    <option value="0">热销</option>
                    <option value="1">推荐</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline">
                <input type="text" value="" name="name" placeholder="请输入产品名字" class="layui-input search_input">
            </div>
            <button type="submit" class="layui-btn search_btn">查询</button>
        </div>
    </form>
</blockquote>
<div class="layui-form news_list">
    <table class="layui-table">
        <colgroup>
            <col width="50">
            <col>
            <col width="9%">
            <col width="9%">
            <col width="9%">
            <col width="9%">
            <col width="9%">
            <col width="15%">
            <col width="15%">
        </colgroup>
        <thead>
        <tr>
            <th><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose" id="allChoose"></th>
            <th style="text-align:left;">产品名称</th>
            <th>图片</th>
            <th>价格</th>
            <th>热销</th>
            <th>推荐</th>
            <th>赞助品</th>
            <th>上架</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody class="news_content">
            {volist name="data" id="vo"}
            <tr>
                <td><input type="checkbox" name="" lay-skin="primary" lay-filter="choose"></td>
                <td style="text-align:left;">{$vo.name}</td>
                <td>
                    {notempty name="vo.thumb"}
                        <a class="element" href="{:url('product_image', ['id' => $vo['id']])}">
                            <img style="max-width: 120px; max-height: 120px;" src="{$vo.thumb|get_img_url}" />
                        </a>
                    {else /}
                        <a href="{:url('product_image', ['id' => $vo['id']])}" class="layui-btn layui-btn-mini">编辑图片</a>
                    {/notempty}
                </td>
                <td>{$vo.price}</td>
                <td class="save_field">
                    {eq name="vo.is_hot" value="1"}
                        <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '0', 'field' => 'is_hot'])}" data-title="取消热销？" class="layui-btn layui-btn-mini">是</a>
                    {else /}
                        <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '1', 'field' => 'is_hot'])}" data-title="设置为热销？" class="layui-btn layui-btn-mini layui-btn-danger">否</a>
                    {/eq}
                </td>
                <td class="save_field">
                    {eq name="vo.is_recommend" value="1"}
                        <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '0', 'field' => 'is_recommend'])}" data-title="取消推荐？" class="layui-btn layui-btn-mini">是</a>
                    {else /}
                        <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '1', 'field' => 'is_recommend'])}" data-title="设置为推荐？" class="layui-btn layui-btn-mini layui-btn-danger">否</a>
                    {/eq}
                </td>
                <td class="save_field">
                    {eq name="vo.is_sponsor" value="1"}
                        <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '0', 'field' => 'is_sponsor'])}" data-title="设置为正常商品？" class="layui-btn layui-btn-mini">是</a>
                    {else /}
                        <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '1', 'field' => 'is_sponsor'])}" data-title="设置为赞助商品？" class="layui-btn layui-btn-mini layui-btn-danger">否</a>
                    {/eq}
                </td>
                <td class="save_field">
                    {eq name="vo.status" value="1"}
                        <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '2', 'field' => 'status'])}" data-title="上级商品？" class="layui-btn layui-btn-mini layui-btn-danger">已下架</a>
                    {else /}
                        <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '1', 'field' => 'status'])}" data-title="下架商品？" class="layui-btn layui-btn-mini">已上架</a>
                    {/eq}
                </td>
                <td class="save_field">
                    <a class="layui-btn layui-btn-normal  layui-btn-mini Add_btn no_save" data-url="{:url('product_save', ['id' => $vo['id']])}" data-title="编辑产品">编辑</a>
                    <a href="javascript:;" data-url="{:url('save_field', ['id' => $vo['id'], 'value' => '2', 'field' => 'delete'])}" data-title="删除商品？" class="layui-btn layui-btn-mini">删除</a>
                </td>
            </tr>
            {/volist}
        </tbody>
    </table>
</div>
<div id="page"></div>
{/block}

{block name="javascript"}
{/block}